<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			pre{
				font-size: 20px;
			}
		</style>
	</head>
	<body>
<pre>
	
</pre>
		<div id="box">
			
		</div>
		<script>
			/*
			1.基本数据类型
			2.引用数据类型Array,object
			3.
			var a=1,b=2;
			
			var fn=function(a,b){
				
			}
			
			fn();
			
			function fn2(a,b){
				
			}
			
			4.
			面向对象
			面向过程
			
			
			
			
			
			*/
			
			fgx("1");
			
			
			
			
			
			var a=1;
			var b=2;
			var c=3;
			var d=4;
			fn(a,b);
			function fn(a,b,c){
				var a=11;
				console.log("a:",a,"b:",b,"c:",c,"d:",d);
			}
			
			fgx("2");
			
			//匿名函数
			//自调用/自运行 函数
			;(function(){
				var arr=[1,3,5,7,9,2,4,6];
				var arr2=[1,3,5,7,9,2,4,6];
				//sort
				//面向对象的开发
				arr.sort(function(a,b){
					return a-b;
				});
				console.log("arr:",arr);
				
				//面向过程的开发
				for(var i=0;i<arr2.length;i++){
					for(var k=i+1;k<arr2.length;k++){
						var z;
						if(arr2[i]>arr2[k]){
							z=arr2[i];
							arr2[i]=arr2[k];
							arr2[k]=z;
						}
					}
				}
				
				console.log("arr2:",arr2);
				
			})();
			
			fgx("3");
			fgx("4");
			
			
			
			
			function fgx(str=""){
				console.log(str+"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=");
			}
		</script>
	</body>
</html>
